package com.gaohe.controller;


import com.gaohe.common.R;
import com.gaohe.pojo.StadBuyCard;
import com.gaohe.pojo.StadMember;
import com.gaohe.service.StadBuyCardService;
import com.gaohe.service.StadMemberService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 购会员卡表 前端控制器
 * </p>
 *
 * @author liu
 * @since 2025-04-12
 */
@RestController
@RequestMapping("/buyCard")
public class StadBuyCardController {
    @Autowired
    private StadBuyCardService stadBuyCardService;
    @Autowired
    private StadMemberService stadMemberService;
//    统计未开卡的人数
    @GetMapping("getAllBuyCard")
    public R getAllBuyCard(){
        final List<StadBuyCard> buyCardList = stadBuyCardService.getBuyCardList(1l);
        final List<StadMember> memberList = stadMemberService.getMemberList(1l);
        final int i = memberList.size() - buyCardList.size();
        return R.success(i);
    }
}

